﻿CREATE PROCEDURE [acms].[User_GetAllByRoleIdAndSiteId]
	@RoleId int,
	@SiteId int
AS
	declare @Date datetime
	set @Date = getUtcDate()

	SELECT DISTINCT a.* 
	From User_View a
		inner join UserRole_View b on a.Id = b.UserId and isNull([Start], '0001/01/01') <= @Date and IsNull([End], '9999/12/31') > @Date
	--Where b.RoleId = @RoleId and b.SiteId = @SiteId and isNull(a.SiteId, @SiteId) = @SiteId
	
	RETURN 0;